<!DOCTYPE html>
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>钉钉自动登陆</title>
    <script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.7.13/dingtalk.open.js"></script>
</head>
<body>
<form action="{:cmf_plugin_url('Dingding://Index/dologin',['app'=>$app,'corp'=>$corp,'adm'=>$adm])}" id="ddform" method="post">
    <input type="hidden" value="" id="authCode" name="authCode">
</form>
<script>
    dd.ready(function() {
        dd.runtime.permission.requestAuthCode({
            corpId: '{$corpid}', // 企业id
            onSuccess: function (info) {
                code = info.code // 通过该免登授权码可以获取用户身份
                document.getElementById("authCode").value=code;
                document.getElementById("ddform").submit();
            },
            onFail: function(err) {
                document.write('验证失败');
            }
        });
    });

</script>
</body>
</html>